Function: append(domElementOrMarkupStringOrCSSSelector, domInsertionElement, functionCallback(domElement))
Description: Inserts a DOM element, markup string, or CSS selector referenced element at the end of a target element in the DOM.
Returns: domElement, or $A object if chained.
Example:
// Insert a DOM element at the end of another element targetted with a CSS selector
var myElement = $A.append(domElement, "#myTargetNodeId");
// Insert a markup string element at the end of another DOM element
var myElement = $A.append('
Here we are now, entertain us.
', domElement);
// Insert one element referenced by a CSS selector at the end of another DOM element
var myElement = $A.append("#myTargetNodeToMove", domElement);
// Insert a DOM element at the end of another DOM element and exicute a callback when done
var myElement = $A.append(domElementToMove, domElementToTarget, function(domElementToMove) {
// Do something with domElementToMove after the insertion is complete.
});
// Or the same using chaining
// Insert a DOM element at the end of another element targetted with a CSS selector
var myChain = $A("#myTargetNodeId").append(domElement);
// Insert a markup string element at the end of another DOM element
var myChain = $A(domElement).append('Here we are now, entertain us.
');
// Insert one element referenced by a CSS selector at the end of another DOM element
var myChain = $A(domElement).append("#myTargetNodeToMove");
// Insert a DOM element at the end of another DOM element and exicute a callback when done
var myChain = $A(domElementToTarget).append(domElementToMove, function(domElementToMove) {
// Do something with domElementToMove after the insertion is complete.
});
// To return the modified element within a chain, use the "return()" method.
var myElement = myChain.return();